PARAM([int]$PageSize,[int]$ImportLastCount)

$User = Import-Csv "C:\PSTest0.txt"

#$Roles = @()
$RolesList = New-Object System.Collections.ArrayList($null)


$csObject = @{}
$csObject.Add(".objectType","Person")
$csObject.Add(".ObjectModificationType","Add")

foreach($item in $User)
{
    $attribute = $item.attribute
    $value = $item.value
    switch($attribute)
    {
     "Roles" { $RolesList.Add($value) }  
     default { $csObject.Add($attribute,$value) }
    }
}
$csObject.Add("Roles",$RolesList.ToArray())
$csObject